]> dgit.raspbian.org Git - gnome-shell.git/commit
js: Add utility to improve error message formatting
authorPhilip Chimento <philip.chimento@gmail.com>
Wed, 3 Jan 2024 00:16:00 +0000 (16:16 -0800)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 4 Jan 2024 18:59:33 +0000 (18:59 +0000)
commita1a320d3d1bd73b150094bfcd0558cf5c9d4ad4c
tree1d5fbaaf7d820bd3e369c3f23e39cc5895192a61
parent5fe6e5c865cdfde065ba1890da3cd733a31b33c3
js: Add utility to improve error message formatting

Previously, when we formatted SyntaxErrors with toString(), they
wouldn't display the file/line/column where the syntax error occurred.
This adds a utility function that performs a more comprehensive
formatting that displays location information for SyntaxErrors, as well
as the .cause property of the error if it is present. This formatting is
equivalent to what we do in gjs-console when logging an error.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3041>
js/js-resources.gresource.xml
js/misc/errorUtils.js [new file with mode: 0644]